package dao;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.NoResultException;
import javax.persistence.TypedQuery;

import entity.TreatmentAct;

@JPA
@Stateless
public class JPATreatmentActDAO extends GenericJPADAO<TreatmentAct> implements TreatmentActDAO {

	@Override
	public List<TreatmentAct> selectActListByUserId(int userId) {
		List<TreatmentAct> res = null;
		try {
			TypedQuery<TreatmentAct> query = em.createNamedQuery("TreatmentAct.selectByClientId", TreatmentAct.class).setParameter("id", userId);
			res = query.getResultList();
		} catch(NoResultException nre) {}
		return res;		
	}
	
}
